package models

import "fmt"

type GatesBuildings struct {
	GbId       int           `json:"gb_id"`
	Uid        string        `json:"uid"`
	GateId     int           `json:"gate_id"`
	BuildingId int           `json:"building_id"`
	ZoneId     int64 `json:"zone_id"`
	CreatedAt  int64 `json:"created_at"`
	UpdatedAt  int64 `json:"updated_at"`
	DeletedAt  int64 `json:"deleted_at"`
}

//获取小区楼栋关联的门禁机
func GetGatesBuildingsInfo(BuildingId int64,ZoneId int) ([]int64, error) {
	fmt.Println("GetGatesBuildingsInfo")
	var gateId []int64
	db.Table("ims_gates_buildings").
		Where("building_id = ? and zone_id = ? ", BuildingId,ZoneId).
		Pluck("gate_id", &gateId)
 	fmt.Println(gateId)
	return gateId, nil
}